package router

import (
	"github.com/gin-gonic/gin"
	"sub_web/src/api"
	"sub_web/src/middlewares"
)

func BindSubRouter(group *gin.RouterGroup) {
	group.Group("/subscribe")
	group.POST("/createsub", middlewares.JWTAuth(), api.CreateSub)
	group.GET("/getsublist", api.GetSubList)
	group.GET("/getsubbyid", api.GetSubById)
	group.GET("/getsubname", api.GetSubBySubName)
	group.GET("/getsubbyuserid", middlewares.JWTAuth(), api.GetSubByUserId)
	group.POST("/updatesub", middlewares.JWTAuth(), api.UpdateSub)
	group.DELETE("/deletesub", middlewares.JWTAuth(), api.DeleteSub)
}
